<?php
/**
 * Created by PhpStorm.
 * User: mr.lee
 * Date: 2018-12-21
 * Time: 21:18
 */

namespace app\common\controller;


use app\common\model\Merchant;
use app\common\model\ProfitList;
use think\Controller;

class Fenzhang extends Controller
{
    public function createlog($param)
    {
        $Merchant = new Merchant();
        $is_profit = $Merchant->where(['id' => $param['mid']])->value('is_profit');
        if ($is_profit == "Y") {
            $data['mid'] = $param['mid'];
            $data['oid'] = $param['id'];
            $data['orderid'] = $param['orderid'];
            $data['orderno'] = $param['orderno'];
            $data['price'] = $param['price'] - $param['service_charge'];
            $data['status'] = "N";
            $data['create_time']=time();
            $ProfitList = new ProfitList();
            $ProfitList->save($data);
        }

    }
}